package com.jmp.security.grant.jxsApp;

import com.jmp.security.base.RequestDetail;
import com.jmp.base.dto.ClientEnum;
import lombok.Builder;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import one.stand.advice.ResultEnum;
import one.stand.enums.LoginEnum;
import one.stand.util.AssertUtil;

@Data
@Builder
@Slf4j
public class JxsAppSmsRequestDetail implements RequestDetail {
    private ClientEnum clientEnum;
    private String phone;
    private String smsCode;
    /**
     * 登陆client key
     */
    private String companyKey;
    /**
     * push client id
     */
    private String pushCid;

    @Override
    public LoginEnum getLoginEnum() {
        return LoginEnum.JXS_APP;
    }

    @Override
    public String getEquCode() {
        return null;
    }

    @Override
    public Integer getEquCodeType() {
        return null;
    }

    @Override
    public void initAfter() {
        AssertUtil.nonNull(phone, ResultEnum.PARAM_CHECK, "手机号码不能为空");
        AssertUtil.nonNull(smsCode, ResultEnum.PARAM_CHECK, "验证码不能为空");
    }
}